package ovm.gui.views.administration.factory;

import ovm.gui.views.AbstractCatalogView;
import ovm.management.AbstractManager;

import static ovm.application.MainApplication.navigator;

/**
 * Created by IntelliJ IDEA.
 * User: Jokser
 * Date: 02.06.12
 * Time: 17:45
 * To change this template use File | Settings | File Templates.
 */

public class EntityFormPropertiesView extends AbstractCatalogView {

    public EntityFormPropertiesView(Class entityClass, Boolean editable) {
        super(entityClass, editable);
        setCaption("Настройка отображаемых элементов сущностей в ФОРМЕ");
    }

    @Override
    protected void setContainerProperties() {
        //entityContainer.addContainerProperty("id", Integer.class, null, true, true);
        entityContainer.addContainerProperty("entity", String.class, "Entity", true, true);
        entityContainer.addContainerProperty("propertyName", String.class, "", true, true);
        entityContainer.addContainerProperty("required", Integer.class, null, true, true);
        entityContainer.addContainerProperty("rusCaption", String.class, "", true, true);
        entityContainer.addContainerProperty("description", String.class, "", true, true);
        //entityContainer.addContainerProperty("engCaption", String.class, "", true, true);
        //entityContainer.addContainerProperty("kazCaption", String.class, "", true, true);
        entityContainer.addContainerProperty("orderNumber", Integer.class, null, true, true);
    }

    @Override
    protected void buildTable() {
        /*
        table.setVisibleColumns(new Object[]{"entity", "propertyName", "rusCaption", "engCaption", "kazCaption", "orderNumber"});
        table.setColumnWidth("entity", 150);
        table.setColumnWidth("propertyName", 150);
        table.setColumnWidth("rusCaption", 150);
        table.setColumnWidth("engCaption", 150);
        table.setColumnWidth("kazCaption", 150);
        table.setColumnWidth("orderNumber", 50);
        */
    }

    @Override
    protected int addNewEntity() {
        return AbstractManager.addDefaultEntity(entityClass);
    }


}
